GtkFontButton: Fix the handling of show-preview-button
authorMatthias Clasen <mclasen@redhat.com>
Sun, 8 Jun 2014 15:57:47 +0000 (11:57 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 9 Jun 2014 17:31:02 +0000 (13:31 -0400)
We were not storing the value at all, and not notifying.

gtk/gtkfontbutton.c

index 70c024f875d07c020331e4cfa7540a0882a9e8de..e780e48b62a5cd345ce89096b9e2e7aa79d955cc 100644 (file)
@@ -272,10 +272,15 @@ gtk_font_button_set_show_preview_entry (GtkFontButton *font_button,
 {
   GtkFontButtonPrivate *priv = font_button->priv;
 
-  if (priv->font_dialog)
-    gtk_font_chooser_set_show_preview_entry (GTK_FONT_CHOOSER (priv->font_dialog), show);
-  else
-    priv->show_preview_entry = show != FALSE;
+  show = show != FALSE;
+
+  if (priv->show_preview_entry != show)
+    {
+      priv->show_preview_entry = show;
+      if (priv->font_dialog)
+        gtk_font_chooser_set_show_preview_entry (GTK_FONT_CHOOSER (priv->font_dialog), show);
+      g_object_notify (G_OBJECT (font_button), "show-preview-entry");
+    }
 }
 
 static PangoFontFamily *